<?php

/**
 * SimpleTest test suite for the PHP Gamercard API
 *
 * To use:
 * 1. Update the configs below.
 * 2. Download SimpleTest from http://simpletest.sourceforge.net and
 *    update the path to it below.
 * 3. Point your browser at this file.
 */

require_once('/Users/jrbeeman/Downloads/simpletest/autorun.php');
require_once('../src/Gamercard.php');

class GamercardTest extends UnitTestCase {
  
  private $config = array(
    'gamertag' => 'Major Nelson',
  );
  
  function testGamercard() {
    $gamertag = $this->config['gamertag'];
    $gamercard = new Gamercard($gamertag);
    $result = $gamercard->render();
    $this->dump($result);
    $this->assertTrue(strstr($result, rawurlencode($gamertag)), 'Appropriate URL generated for Gamercard iFrame');
    $result = $gamercard->data();
    $this->assertEqual($result->Gamertag, $gamertag, 'Retrieved detailed Gamertag data');
    $this->dump($result);
  }
  
}

?>